<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2021/12/13
  Time: 17:09
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.List" %>
<%@ page import="com.yyyzzz.bean.Course" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.yyyzzz.service.courseService" %>
<%@ page import="com.yyyzzz.service.impl.courseServiceimpl" %>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="utf-8" language="java" %>
<%--<style>
    .odd{
        background-color: #999e98;
    }
    .even{
        background-color: #4f5152;
    }--%>
</style>
<html>
<head>
    <title>我的课表</title>
    <link rel="stylesheet" href="chooseCourse/chooseCourse.css" type="text/css">

</head>

<div>
</div>
<body>
<center>
    <header>
        <a href="#" class="logo">学生选课系统</a>
        <ul>
            <li>
                <a href="studentMain.jsp" >可选课程</a>

            </li>
            <li><a href="#" class="active">已选课程</a>
            </li>
            <li><a href="updateStudentInfo.jsp">修改个人信息</a>
            </li>
            <li><a href="#"></a></li>
        </ul>
    </header>
    <section>
        <img src="Login/stars.png" id="stars">
        <img src="Login/moon.png" id="moon">
        <img src="Login/mountainsbehind.png" id="mountains_behind">
        <img src="Login/mountainsfront.png" id="mountains_front">

            <div id="sec" class="sec">
                <div>
                    <table cellspacing="0" class="tab">
                        <caption>课程信息</caption>

                        <tr>
                            <td align="center">
                                课程号
                            </td>
                            <td align="center">
                                课程名
                            </td>

                            <td align="center">
                                任课教师
                            </td>
                            <td align="center">
                                教室
                            </td>
                            <td align="center">
                                学分
                            </td>
                            <td align="center" colspan="2" id="">
                                操作
                            </td>

                        </tr>
                        <%
                            courseService service = new courseServiceimpl();
                            List<Course> courseList = service.getAll();
                            request.setAttribute("courseList", courseList);
                            Object obj = request.getAttribute("courseList");
                  /*  if (obj != null) {
                        List<Course> courseList1 = (List) obj;
                        for (Course course : courseList1) {*/
                        %>
                        <c:forEach items="${studentcourseList}" var="course" varStatus="vs">

                        <tr class="${vs.count%2==0?'even':'odd'}">
                            <td align="center">
                            ${course.courseId}
    <%-- <%=course.getCourseId()%>--%>
    </td>
    <td align="center">
    ${course.courseName}
    <%--  <%=course.getCourseName()%>--%>
    </td>
    <td align="center">
    ${course.courseTeacher}
    <%--<%=course.getCourseTeacher()%>--%>
    </td>
    <td align="center">
    ${course.classroom}
    <%--<%=course.getClassroom()%>--%>
    </td>
    <td align="center">
    ${course.credit}
    <%--<%=course.getCredit()%>--%>
    </td>

    <td id="cao1" align="center">
    <a style="color: #ff0000;"
    href="deleteStuCourseServlet?courseid=${course.courseId}<%--<%=course.getCourseId()%>--%>"
    onClick="if(!confirm('您确定退选该课程吗？'))
    return false;else return true;">退选</a>
    </td>

    </tr>

</c:forEach>


</table>
</div>

</div>
    </section>



</center>
</body>
</html>
